<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/aftersaleinfo/aftersale/q_aftersale.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/aftersaleinfo/aftersale/q_aftersale.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Aftersale',
                footer: "Foots",
                cnName: '售后服务单',
                name: 'aftersale/q_aftersale',
                url: "/q_aftersale/",
                sortName: "Voucher_sub"
            });
            const editFormFields = ref({"Voucher_sub":"","Project_name":"","Type":"","Code":"","Client":"","Client_man":"","Client_tel":"","Client_man2":"","Project_class":"","Service_clsaa":"","Post_mode":"","Post_number":"","Servicing_time":"","Return_date":"","Return_date_required":"","Return_address":"","Fault":"","Solve_fault":"","Attachment":"","Image":"","Remark":"","Maintain_state":"","Contract_state":""});
            const editFormOptions = ref([[{"title":"单据编码","field":"Voucher_sub","type":"text"},
                               {"title":"项目名称","required":true,"field":"Project_name","type":"text"},
                               {"title":"设备型号","required":true,"field":"Type","type":"text"},
                               {"title":"设备编号","required":true,"field":"Code","type":"text"}],
                              [{"dataKey":"无条件客户","data":[],"title":"客户","required":true,"field":"Client","type":"select"},
                               {"title":"联系人","required":true,"field":"Client_man","type":"text"},
                               {"title":"联系电话","required":true,"field":"Client_tel","type":"phone"},
                               {"title":"设备返回人","required":true,"field":"Client_man2","type":"text"}],
                              [{"dataKey":"项目等级","data":[],"title":"项目等级","required":true,"field":"Project_class","type":"select"},
                               {"dataKey":"维修类别","data":[],"title":"维修类别","required":true,"field":"Service_clsaa","type":"select"},
                               {"title":"邮寄方式","field":"Post_mode","type":"text"},
                               {"title":"单号","field":"Post_number","type":"text"}],
                              [{"title":"返厂日期","required":true,"field":"Return_date","type":"datetime"},
                               {"title":"需返还日期","required":true,"field":"Return_date_required","type":"datetime"},
                               {"title":"维修时间","field":"Servicing_time","type":"number"},
                               {"title":"返还地址","required":true,"field":"Return_address","type":"textarea"}],
                              [{"title":"故障描述","required":true,"field":"Fault","colSize":6,"type":"textarea"},
                               {"title":"现场故障处理过程","required":true,"field":"Solve_fault","colSize":6,"type":"textarea"}],
                              [{"title":"备注","field":"Remark","colSize":6,"type":"text"},
                               {"title":"附件","field":"Attachment","type":"file"},
                               {"title":"图片","field":"Image","type":"img"}],
                              [{"dataKey":"维修状态","data":[],"title":"维修状态","field":"Maintain_state","type":"select"},
                               {"dataKey":"合同状态","data":[],"title":"合同状态","field":"Contract_state","type":"select"}]]);
            const searchFormFields = ref({"Voucher_sub":"","Project_name":"","Project_class":"","Service_clsaa":"","Client":"","Client_man":"","Return_date_required":"","AuditStatus":""});
            const searchFormOptions = ref([[{"title":"单据编码","field":"Voucher_sub","type":"like"},{"title":"项目名称","field":"Project_name","type":"like"},{"dataKey":"无条件客户","data":[],"title":"客户","field":"Client","type":"select"},{"title":"联系人","field":"Client_man","type":"like"}],[{"dataKey":"项目等级","data":[],"title":"项目等级","field":"Project_class","type":"select"},{"dataKey":"维修类别","data":[],"title":"维修类别","field":"Service_clsaa","type":"select"},{"title":"需返还日期","field":"Return_date_required","type":"datetime"},{"dataKey":"audit","data":[],"title":"审核状态","field":"AuditStatus","type":"select"}]]);
            const columns = ref([{field:'Voucher_sub',title:'单据编码',type:'string',link:true,width:180,align:'left',sort:true},
                       {field:'Project_name',title:'项目名称',type:'string',width:220,require:true,align:'left'},
                       {field:'Type',title:'设备型号',type:'string',width:220,require:true,align:'left'},
                       {field:'Code',title:'设备编号',type:'string',width:220,require:true,align:'left'},
                       {field:'Project_class',title:'项目等级',type:'int',bind:{ key:'项目等级',data:[]},width:80,require:true,align:'left'},
                       {field:'Service_clsaa',title:'维修类别',type:'int',bind:{ key:'维修类别',data:[]},width:80,require:true,align:'left'},
                       {field:'Servicing_time',title:'维修时间',type:'float',width:110,align:'left'},
                       {field:'Client',title:'客户',type:'int',bind:{ key:'无条件客户',data:[]},width:110,require:true,align:'left'},
                       {field:'Client_man',title:'联系人',type:'string',width:120,require:true,align:'left'},
                       {field:'Client_tel',title:'联系电话',type:'string',width:120,require:true,align:'left'},
                       {field:'Client_man2',title:'设备返回人',type:'string',width:120,require:true,align:'left'},
                       {field:'Post_mode',title:'邮寄方式',type:'string',width:220,align:'left'},
                       {field:'Post_number',title:'单号',type:'string',width:120,align:'left'},
                       {field:'Return_date',title:'返厂日期',type:'datetime',width:155,require:true,align:'left',sort:true},
                       {field:'Return_date_required',title:'需返还日期',type:'datetime',width:155,require:true,align:'left',sort:true},
                       {field:'Return_address',title:'返还地址',type:'string',width:220,require:true,align:'left'},
                       {field:'Fault',title:'故障描述',type:'string',width:220,require:true,align:'left'},
                       {field:'Solve_fault',title:'现场故障处理过程',type:'string',width:220,require:true,align:'left'},
                       {field:'Maintain_state',title:'维修状态',type:'int',bind:{ key:'维修状态',data:[]},width:80,align:'left'},
                       {field:'Contract_state',title:'合同状态',type:'int',bind:{ key:'合同状态',data:[]},width:80,align:'left'},
                       {field:'AuditStatus',title:'审核状态',type:'int',bind:{ key:'audit',data:[]},width:110,align:'left'},
                       {field:'Attachment',title:'附件',type:'file',width:110,align:'left'},
                       {field:'Image',title:'图片',type:'img',width:110,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:220,align:'left'},
                       {field:'AuditDate',title:'审核时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'AuditID',title:'审核人员id',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Auditor',title:'审核人员',type:'string',width:120,hidden:true,align:'left'},
                       {field:'CreateID',title:'创建人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'Aftersale',title:'ID',type:'guid',width:110,hidden:true,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
